package com.wbcs.system.commoninterface;

import javax.servlet.http.HttpServletRequest;

import com.wbcs.config.component.container.page.PageBean;

public class DefaultPagePersonalizePersistenceImpl implements IPagePersonalizePersistence
{
    public String loadSkin(HttpServletRequest request,PageBean pbean)
    {
        if(request!=null&&request.getSession()!=null)
        {
            if(pbean!=null)
            {
                return (String)request.getSession().getAttribute("dynskin_"+pbean.getId());
            }else
            {
                return (String)request.getSession().getAttribute("dynskin");
            }
        }
        return null;
    }

    public void storeSkin(HttpServletRequest request,PageBean pbean,String skin)
    {
        if(request!=null&&request.getSession()!=null)
        {
            if(pbean!=null)
            {
                request.getSession().setAttribute("dynskin_"+pbean.getId(),skin);
            }else
            {
                request.getSession().setAttribute("dynskin",skin);
            }
        }
    }
}

